/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package otcapp.experto.decoradores;

import otcapp.dto.InternoDTO;
import otcapp.experto.ExpertoIngresarInterno;
import otcapp.experto.excepciones.ExpertoInternoException;
import persistencia.Conexion;

/**
 *
 * @author diego
 */
public class ExpertoInternoDecorador extends ExpertoIngresarInterno{
    @Override
    public void guardarInterno(InternoDTO dtoInterno) throws ExpertoInternoException {
        try {
            Conexion.getInstancia().iniciarTX();
            super.guardarInterno(dtoInterno);
            Conexion.getInstancia().confirmarTx();
        } catch (ExpertoInternoException ex) {
            Conexion.getInstancia().deshacerTx();
            throw ex;
        }
    }
}
